$(function(){
	var url = location.href;
	$('#logout').attr('href',config.client + $('#logout').attr('href'));
	$('.nav-link').each(function(){
		var href = $(this).attr('href');
		if(href.indexOf('.html')>-1){
			$(this).attr('href',config.client + href);
		}
		if(href.lastIndexOf('/')>-1){
			href = href.substring(0,href.lastIndexOf('/'));
		}
		if(url.indexOf(href)>-1){
			  //取消原来选中的菜单
			  $('.active a .selected','.page-sidebar-menu').remove();
			  $('.active a .arrow','.page-sidebar-menu').attr('class','arrow ');
			  $('.active','.page-sidebar-menu').attr('class','nav-item ');
			  
			  //选中新的菜单
			  $(this).append('<span class="selected"></span>');
			  $(this).parent().attr('class','nav-item start active open');
			  var pp = $(this).parent().parent().parent();
			  pp.attr('class','nav-item start active open');
			  pp.children().eq(0).find('arrow').attr('class','arrow open');
			  pp.children().eq(0).append('<span class="selected"></span>');
			  
			return;
		}
	});
	
})